package com.lyx.server.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * ⽤户邀请表
 * @TableName t_user_invite
 */
@TableName(value ="t_user_invite")
@NoArgsConstructor
@Data
public class UserInvite implements Serializable {
    /**
     * 序号，主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 邀请码
     */
    @TableField(value = "invcode")
    private String invcode;

    /**
     * 邀请⼈
     */
    @TableField(value = "uid")
    private Integer uid;

    /**
     * 被邀请⼈，拉新
     */
    @TableField(value = "askuid")
    private Integer askuid;

    /**
     * 佣⾦
     */
    @TableField(value = "money")
    private double money;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private Date createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    public UserInvite(String invcode, Integer uid, Integer askuid, double money) {
        this.invcode = invcode;
        this.uid = uid;
        this.askuid = askuid;
        this.money = money;
        this.createTime = new Date();
    }
}
